import sun.awt.image.ImageWatched;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Microsoft
 * Date: 2023-03-05
 * Time: 9:12
 */
public class Test {
    public static void main(String[] args) {
        //Deque是一个接口
        Queue<Integer> queue = new LinkedList<>();//队列
        LinkedList<Integer> stack = new LinkedList<>();//链式栈
        List<Integer> list = new LinkedList<>();//链表

        Deque<Integer> deque = new LinkedList<>();
        Deque<Integer> deque1 = new ArrayDeque<>();
    }
    public static void main2(String[] args) {
        Queue<Integer> q = new LinkedList<>();
        q.offer(1);
        q.offer(2);
        q.offer(3);
        q.offer(4);
        q.offer(5); // 从队尾入队列
        System.out.println(q.size());
        System.out.println(q.peek()); // 获取队头元素
        q.poll();
        System.out.println(q.poll()); // 从队头出队列，并将删除的元素返回
        if(q.isEmpty()){
            System.out.println("队列空");
        }else{
            System.out.println(q.size());
        }
    }
    public static void main1(String[] args) {
        MyQueue myQueue = new MyQueue();
        myQueue.offer(1);
        myQueue.offer(2);
        myQueue.offer(3);
        System.out.println(myQueue.peek());
        System.out.println(myQueue.poll());
    }
}
